/* Copyright (c) 2011 Alexandre Défossez
 * This file is part of HINAPT.
 *
 * HINAPT is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * HINAPT is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with HINAPT.  If not, see <http://www.gnu.org/licenses/>.
 */


#include "check.hpp"


using namespace fs;

static DetectorTh cascade;


//Fonction appelée au chargement de la librairie
void __attribute__ ((constructor)) init(void){
  ifstream input("VJ.dat");
  cascade.load(input);
  input.close();
}

int _check(char *path){
  Mat img=imread(path);
  return (cascade.eval(img)==1)?1:0;
}

//Permet d'éviter le "name mangling" des fonctions en C++
extern "C" {
  int check(char *path){
    return _check(path);
  }
};

